Beacon Configuration Admin View, with CRUD and Regenerate and Revoke Tokens Actions#585
Beacon Configuration Admin View, with CRUD and Regenerate and Revoke Tokens Actions#585FionaLMcLaren wants to merge 31 commits intomainfrom
Conversation
…-api-keys - Removed old beacon migration that conflicted with device migrations - Updated BeaconsController to use Beacons::Creator service for API key generation - Changed beacon relationships from direct provider/tags to many-to-many beacon_providers and beacon_topics - Updated forms to use provider_ids and topic_ids multi-selects instead of single provider_id and tag_ids - Updated show page to display API key (when just created) instead of token - Updated index page to show region, language, provider count, and topic count - Removed beacon_tag model and references as we now use beacon_topics - Changed status from online/offline to active/revoked based on revoked_at timestamp
Topics use 'title' column, not 'name'. Updated controller and views to use Topic.active.order(:title)
- Update API key display messaging for admin context - Add regenerate_key action in BeaconsController using KeyRegenerator service - Add 'Regenerate API Key' button on show page with confirmation dialog - Full API key still shown only after creation/regeneration via flash - Clearer messaging that full key is displayed immediately after provisioning
- Added document_count method to Beacon model to count available topics - Added file_count method to count actual attached document files - Updated show page with 4 stat cards: Status, Available Topics, Document Files, and Configured Filters - Logic respects beacon's language, providers (or region if no providers), and topic filters
Resolves #572 Adds actions to revoke and regenerate tokens. Refactors the previous "regenerate" code in the controller to be in a model TODO: - Controller specs for beacons controller - Route for revoking a Token
dbac880 to
ca83796
Compare
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
- Add libffi-dev package to Dockerfile.dev for Alpine Linux to support ffi gem (dependency).
Allows Bundler to resolve dependencies for Darwin 25.
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sean Marcia <seanmarcia@github.com>
2071a2e to
3954d6e
Compare
|
Hey @FionaLMcLaren for a ticket with so many visual elements, it's really helpful to put some screenshots in the PR description, particularly for:
Thanks! Solid work! |
81601e1 to
8dd9f8e
Compare
cd9ea07 to
2464541
Compare
|
@FionaLMcLaren thanks for providing screenshots! Please let us know when it's ready for review. |
e2867e3 to
4cc78e3
Compare
4cc78e3 to
c595113
Compare
|
@devjona This is ready for review! 🫶 |
| <div class="form-grid-full" data-controller="select-tags" data-select-tags-dropdown-parent-value="body"> | ||
| <%= form.label :topic_ids, "Topics", class: "form-label" %> | ||
| <%= form.select :topic_ids, | ||
| options_from_collection_for_select(@topics, :id, :title, beacon.topic_ids), |
There was a problem hiding this comment.
Do you need help with this part?
* Move Javascript logic for copying API key from view to its own stimulus controller, `beacons_controller` * Have full API key appear for copying on beacon creation or when the key is regenerated * New `Beacon` helper for status string display logic * Other refactors
| export default class extends Controller { | ||
| static targets = ["button", "beaconApiKey"] | ||
|
|
||
| copyApiKey() { |
There was a problem hiding this comment.
I'm not sure this copy functionality is working (tried locally).
There was a problem hiding this comment.
We could add to a later ticket, but the user can still see the API Key and manually select, copy.
There was a problem hiding this comment.
What was the outcome in your case?
There was a problem hiding this comment.
There was a mistake with action setup, should be fixed now
|
Can we merge master into this branch please? |
* main: (28 commits) chore(deps): bump rails from 8.1.2 to 8.1.2.1 chore(deps): bump active_storage_validations from 3.0.2 to 3.0.4 chore(deps): bump solid_queue from 1.3.2 to 1.4.0 chore(deps): bump aws-sdk-s3 from 1.215.0 to 1.217.0 chore(deps): bump bcrypt from 3.1.20 to 3.1.22 chore(deps): bump kamal from 2.10.1 to 2.11.0 chore(deps): bump reactionview from 0.2.1 to 0.2.2 chore(deps-dev): bump rspec-rails from 8.0.3 to 8.0.4 chore(deps): bump thruster from 0.1.18 to 0.1.19 chore(deps): bump aws-sdk-s3 from 1.213.0 to 1.215.0 chore(deps-dev): bump faker from 3.6.0 to 3.6.1 chore(deps-dev): bump brakeman from 8.0.2 to 8.0.4 chore(deps): bump actions/upload-artifact from 6 to 7 Add file download endpoint for beacon content sync Add accessible_blobs method to Beacon model chore(deps-dev): bump web-console from 4.2.1 to 4.3.0 chore(deps): bump solid_queue from 1.3.0 to 1.3.2 chore(deps-dev): bump rspec-rails from 8.0.2 to 8.0.3 chore(deps): bump reactionview from 0.2.0 to 0.2.1 Bootstrap Mazer cleanup (#591) ...
Replaced `beacons#copyApiKey` with `click->beacons#copyApiKey` to ensure the Stimulus action is reliably wired up with an explicit event type. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… and region Add a beacon-form Stimulus controller that fetches filtered options from a new filter_options endpoint whenever language or region selectors change. Topics are filtered by language_id; providers are filtered by region through the branches join table. Previously selected values that remain valid are preserved after each filter update. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
What Issue Does This PR Cover, If Any?
Resolves #572
What Changed? And Why Did It Change?
This PR adds the actions to revoke and regenerate tokens. It refactors the previous
"regenerate" code in the controller to be in a model. These actions are accessible to an admin user on their Admin Dashboard, when viewing a Beacon. This PR also does some cleanup on the views here, e.g.: removing the flashes for
:api_key, as the information is already included in the success flashHow Has This Been Tested?
RSpec
Please Provide Screenshots